package com.banksoft.cps.util;

import com.banksoft.cps.bean.Device;
import com.banksoft.cps.bean.SaleOrder;
import com.banksoft.cps.bean.http.request.Request;

/**
 * Created by rongzhao.zhu on 2018/1/11.
 */
public class PullDataUtil {

    public static final  String url="http://api.tlink.io/tlink_interface/api/device/querySensorDataById_bak.htm";
    public static final String pullOk ="00";
    public static final String requestFail = "request_fail";

    public static Request buildRequest(SaleOrder saleOrder,Device device){
        String timeBegin = saleOrder.getTimeBegin();
        String timeEnd = saleOrder.getTimeEnd();
        Request request = new Request();
        request.setStartDate(timeBegin);
        request.setEndDate(timeEnd);
        request.setUserId(device.getUserId());
        request.setSensorId(device.getSensorId());
        return request;
    }

    public static Request  buildRequest(String timeBegin,String timeEnd,Device device){
        Request request = new Request();
        request.setStartDate(timeBegin);
        request.setEndDate(timeEnd);
        request.setUserId(device.getUserId());
        request.setSensorId(device.getSensorId());
        return request;
    }
}
